<template>
    <d2-container>
        <div class="muse_table_box">
      <el-row :span="12" style='background-color: #F6FAFE;height:40px;margin-top:10px;line-height: 40px;padding-left:10px;position: relative;'>
        <div style="font-size:18px;display: inline-block;">昵称：{{privateuser.nickname}}   uid：{{privateuser.uid}}</div>
      </el-row>
          <el-tabs type="border-card">
            <el-tab-pane v-for="(item, index) in detail"  :key="item._id" :label="item.accountName">
              <el-row :span="12" v-if="item.isFans == 1" style='background-color: #F6FAFE;height:40px;margin-top:10px;line-height: 40px;padding-left:10px;position: relative;'>
                <div style="font-size:18px;display: inline-block;">是否关注：是</div>
              </el-row>
              <el-row :span="12" v-else style='background-color: #F6FAFE;height:40px;margin-top:10px;line-height: 40px;padding-left:10px;position: relative;'>
                <div style="font-size:18px;display: inline-block;">是否关注：否</div>
              </el-row>
                <div v-for="(a,b) in item.privateList">
                  <el-tag v-if="a.sendUser=='me'" type="success" style="width:100%;text-align:right;margin:5px">{{a.date+":"+a.text}}</el-tag>
                  <el-tag v-if="a.sendUser=='other'" type="info" style="width:100%;text-align:left;margin:5px">{{a.date+":"+a.text}}</el-tag>
                </div>


              <!-- <el-input
                type="textarea"
                autosize
                placeholder="请输入内容"
                v-model="item.privateList">
              </el-input> -->


            </el-tab-pane>
          </el-tabs>
        </div>
    </d2-container>
</template>

<script>
    import tableMixin from '../mixins/tableMixin'
    import {  getOneUser,getOneChat } from '@/api/admin'
    export default {
    name: 'adminUserList',
    mixins: [tableMixin],
    data () {
      return {
        privateuser:{},
        detail:[],
        accounts:[]
      }
    },
    created () {
      this.id = this.$route.query.id;
      this.getTableData()
    },
    // beforeRouteEnter(to, from, next) {
    //     next(vm=>{
    //       vm.getTableData()
    //     })
    // },
    methods: {
      // 获取列表数据
      async getTableData() {
        const { code, data: { privateuser, detail, accounts } } = await getOneChat({id:this.id})
        console.log('1',privateuser,'2', detail,'3', accounts)
        this.privateuser = privateuser
        this.detail = detail
        this.accounts = accounts
      },
      // async getTableData() {
      //   const { code, data: { privateuser, detail, accounts } } = await getOneUser({id:this.id})
      //   console.log('1',privateuser,'2', detail,'3', accounts)
      //   this.privateuser = privateuser
      //   this.detail = detail
      //   this.accounts = accounts
      // },
    }
  }
</script>

<style lang="less" scoped>

</style>
